home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / os2 / xm198os2.zip / DEV.ZIP / NODEIDX.H < prev   
Text File  |  1995-01-31  |  5KB  |  96 lines

  1. /* ============================================================= 10 Sep 1993 */
  2. /* Indexing system on raw ASCII nodelist (St.Louis/FTS-0005 format)          */
  3. /* COPYRIGHT by A.G. Lentz & LENTZ SOFTWARE-DEVELOPMENT; ALL RIGHTS RESERVED */
  4. /* ------------------------------------------------------------------------- */
  5. #include "2types.h"
  6.  
  7.  
  8. #define NL_IDSTRING                "NLidx"
  9. #define NL_MAJOR                   (1)
  10. #define NL_MINOR                   (0)
  11. #define NL_REVISION                ((NL_MAJOR << 8) | NL_MINOR)
  12. #define NL_REVMAJOR(revision)      (((revision) >> 8) & 0x00ff)
  13. #define NL_REVMINOR(revision)      ((revision) & 0x00ff)
  14.  
  15. #define NL_MAXFILES                (256)
  16. #define NL_ENTFILE(fileofs)        (((int) ((fileofs) >> 24)) & 0x00ff)
  17. #define NL_ENTOFS(fileofs)         ((fileofs) & 0x00ffffffL)
  18. #define NL_ENTRY(fileidx,fileofs)  ((((FILE_OFS) (fileidx)) << 24) | (fileofs))
  19.  
  20. enum { NL_NORM, NL_PVT, NL_HOLD, NL_DOWN, NL_HUB, NL_NC, NL_RC, NL_ZC };
  21. #define NL_TYPEMASK(flags)         ((flags) & 0x07)
  22. #define NL_HASPOINTS               (0x8000)             /* System has points */
  23.  
  24. #define NL_FPERIODIC               (0x0001)             /* Periodic raw file */
  25.  
  26.  
  27. /* HEADER NODE ... NET ... [POINT ... BOSS ...] NAME ... FILE ... ZONE ... */
  28. typedef struct _nlheader NLHEADER;
  29. typedef struct _nlfile   NLFILE;
  30. typedef struct _nlzone   NLZONE;
  31. typedef struct _nlnet    NLNET;
  32. typedef struct _nlnode   NLNODE;
  33. typedef struct _nlboss   NLBOSS;
  34. typedef struct _nlpoint  NLPOINT;
  35.  
  36.  
  37. struct _nlheader {              /* ------- Header record at start of index   */
  38.         char     idstring[5];           /* Nodelist index ID string          */
  39.         char     creator[40];           /* Name/ver index creating program   */
  40.         word     revision;              /* Index format revision major/minor */
  41.         long     timestamp;             /* UNIX timestamp of this index file */
  42.         word     files;                 /* Number of file records            */
  43.         FILE_OFS file_ofs;              /* Offset of file records in index   */
  44.         word     name_size;             /* Total size of name string block   */
  45.         FILE_OFS name_ofs;              /* Offset of name strings in index   */
  46.         word     zones;                 /* Number of zone records            */
  47.         FILE_OFS zone_ofs;              /* Offset of zone records in index   */
  48.         word     bosses;                /* Number of boss records            */
  49.         FILE_OFS boss_ofs;              /* Offset of boss records in index   */
  50. };
  51.  
  52. struct _nlfile {                /* ------- File record --------------------- */
  53.         long    timestamp;              /* UNIX timestamp of this raw file   */
  54.         word    file_flags;             /* Information flags                 */
  55.         word    name_ofs;               /* Ofs in name string block to fname */
  56. };
  57.  
  58. struct _nlzone {                /* ------- Zone record --------------------- */
  59.         word     zone;                  /* Zone number                       */
  60.         word     flags;                 /* Information flags                 */
  61.         FILE_OFS entry;                 /* File number and offset to entry   */
  62.         word     nets;                  /* Number of nets in this zone       */
  63.         FILE_OFS net_ofs;               /* Offset of net records in index    */
  64. };
  65.  
  66. struct _nlnet {                 /* ------- Net record ---------------------- */
  67.         word     net;                   /* Net number                        */
  68.         word     flags;                 /* Information flags                 */
  69.         FILE_OFS entry;                 /* File number and offset to entry   */
  70.         word     nodes;                 /* Number of nodes in this net       */
  71.         FILE_OFS node_ofs;              /* Offset of node records in index   */
  72. };
  73.  
  74. struct _nlnode {                /* ------- Node record --------------------- */
  75.         word     node;                  /* Node number                       */
  76.         word     flags;                 /* Information flags                 */
  77.         FILE_OFS entry;                 /* File number and offset to entry   */
  78. };
  79.  
  80. struct _nlboss {                /* ------- Boss record --------------------- */
  81.         word     zone, net, node;       /* Node number                       */
  82.         word     flags;                 /* Information flags                 */
  83.         FILE_OFS entry;                 /* File number and offset to entry   */
  84.         word     points;                /* Number of points under this node  */
  85.         FILE_OFS point_ofs;             /* Offset of point records in index  */
  86. };
  87.  
  88. struct _nlpoint {               /* ------- Point record -------------------- */
  89.         word     point;                 /* Point number                      */
  90.         word     flags;                 /* Information flags                 */
  91.         FILE_OFS entry;                 /* File number and offset to entry   */
  92. };
  93.  
  94.  
  95. /* end of nodeidx.h */
  96.